package com.xueyi.system.BaseRegulation.domain.po;

import cn.hutool.json.JSONArray;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.OrderBy;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xueyi.common.core.web.tenant.base.TBaseEntity;
import com.xueyi.system.BaseRegulation.domain.dto.BaseRegulationDto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.xueyi.common.core.annotation.Excel;

import java.time.LocalDateTime;

/**
 * 种植技术规程 持久化对象
 *
 * @author xueyi
 */
@TableName(value = "base_regulation", excludeProperty = {"sort"}, autoResultMap = true)
public class BaseRegulationPo extends TBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 文件编码
     */
    @Excel(name = "文件编码")
    @TableField("code")
    private String code;

    /**
     * 类型多选（..字典中有）
     */
    @Excel(name = "类型多选", readConverterExp = ".=.字典中有")
    @TableField("type")
    private String type;

    /**
     * 规程文件
     */
    @Excel(name = "规程文件")
    @TableField(value = "appendix", typeHandler = FastjsonTypeHandler.class)
    private JSONArray appendix;

    /**
     * 制定人
     */
    @Excel(name = "制定人")
    @TableField("designer")
    private String designer;

    /**
     * 执行日期
     */
    @OrderBy(sort = 20)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "ex_date", insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime exDate;


    public LocalDateTime getExDate() {
        return exDate;
    }

    public void setExDate(LocalDateTime exDate) {
        this.exDate = exDate;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public void setAppendix(JSONArray appendix) {
        this.appendix = appendix;
    }

    public JSONArray getAppendix() {
        return appendix;
    }

    public void setDesigner(String designer) {
        this.designer = designer;
    }

    public String getDesigner() {
        return designer;
    }

}
